https://pubmed.ncbi.nlm.nih.gov/39392750/ Fig 4, panel G and N these figures has y axis structure that can easily me misinterpreted. the difference beween the two conditions look bigger than it actually is. while it might me justifiable, i think it should the actually poings for the daf-2 should have been not too close to 0 because it makes it look like it is 0, but it probably isn’t.
2
library(palmerpenguins)
Attaching package: 'palmerpenguins'
The following objects are masked from 'package:datasets':
penguins, penguins_raw
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag() masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
Attaching package: 'plotly'
The following object is masked from 'package:ggplot2':
last_plot
The following object is masked from 'package:stats':
filter
The following object is masked from 'package:graphics':
layout
# packages requiring extra installation stepslibrary(ggmagnify)# datalibrary(palmerpenguins)
data <- penguinsplot <-ggplot(data = data,aes(x = flipper_length_mm, y = bill_length_mm)) +geom_point(na.rm =TRUE, alpha =0.5) +labs(x ="Flipper length (mm)",y ="Bill length (mm)",title ="Data source: Palmer penguins") +theme_bw()ggplotly(plot) #flipper legnth 181, bill length 58 is the outlier point
ggplot(data = data,aes(x = flipper_length_mm, y = bill_length_mm)) +geom_point(na.rm =TRUE, alpha =0.5, size =1.5) +geom_point(aes(x =180.5, y =58), color ="red", size =3) +annotate("segment", x =190, y =60, xend =181, yend =58,arrow =arrow(length =unit(0.3, "cm"), type ="open")) +annotate("text",x =195,y =60,label ="Outlier?") +#looked up the syntax for annotate and the segment and text features labs(x ="Flipper length (mm)",y ="Bill length (mm)",title ="Data source: Palmer penguins") +theme_bw()
Warning in geom_point(aes(x = 180.5, y = 58), color = "red", size = 3): All aesthetics have length 1, but the data has 344 rows.
ℹ Please consider using `annotate()` or provide this layer with data containing
a single row.
Rows: 39094 Columns: 9
── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
chr (2): geoid, state
dbl (6): cases, cases_avg, cases_avg_per_100k, deaths, deaths_avg, deaths_a...
date (1): date
ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
display.brewer.all()
color.scheme <-brewer.pal(9,"Reds")# not states: Puerto Rico, Virgin Islands, Guam, Northern Mariana Islands, American Samoadata_with_states_only <- data_for_heatmap |>filter(!state %in%c("Puerto Rico", "Virgin Islands", "Guam", "Northern Mariana Islands", "American Samoa", "Hawaii"))unique(data_with_states_only$state)